﻿@using Webdiyer.WebControls.Mvc
@model Web.Controllers.QueryModel
@{
    Layout = null;
    ViewBag.Nav = 3;
    ViewBag.Menu = 0;
    int ti = 1;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>病例录入</title>
    @Html.Partial("meta")
</head>
<body id="b_main">
    @Html.Partial("header")
    <!--/end #header-->
    <div id="wrapper">
        <!--holds pretty much everything-->
        @Html.Action("index", "news")
        <!--/end #menu_main-->
        <div id="content">
            @Html.Partial("nav")
            @using (Html.BeginForm("manage", "doc", FormMethod.Get, new { @class = "broom_form", id = "form1", style = "margin-left: 30px;" }))
            {
                <table border="0" cellspacing="0" summary="table" class="broom_table">
                    <tbody>
                        <tr class="odd">
                            <td style="border-right: 0px; width: 400px;">
                                病例编号
                                @Html.TextBoxFor(i => i.DocNO, new { @class = "inputbox" })
                            </td>
                            <td>
                                @if (Web.Controllers.Common.Admin())
                                {
                                    <text>录入人</text>
                                    @Html.TextBoxFor(i => i.UserName, new { @class = "inputbox" })
                                }
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table border="0" cellspacing="0" summary="table" class="broom_table">
                    <tbody>
                        <tr class="even">
                            <td>
                                <div>
                                    录入时间</div>
                            </td>
                            <td style="border-right: 0px;">
                                开始时间
                            </td>
                            <td style="border-right: 0px; width: 250px;">
                                <div class="rili">
                                    @Html.TextBox("InputStart", Model != null && Model.InputStart.HasValue ? Model.InputStart.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                                </div>
                            </td>
                            <td style="border-right: 0px;">
                                结束时间
                            </td>
                            <td>
                                <div class="rili">
                                    @Html.TextBox("InputEnd", Model != null && Model.InputEnd.HasValue ? Model.InputEnd.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table border="0" cellspacing="0" summary="table" class="broom_table">
                    <tbody>
                        <tr class="odd">
                            <td>
                                审核日期
                            </td>
                            <td style="border-right: 0px;">
                                开始时间
                            </td>
                            <td style="border-right: 0px; width: 250px;">
                                <div class="rili">
                                    @Html.TextBox("AuditStart", Model != null && Model.AuditStart.HasValue ? Model.AuditStart.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                                </div>
                            </td>
                            <td style="border-right: 0px;">
                                结束时间
                            </td>
                            <td>
                                <div class="rili">
                                    @Html.TextBox("AuditEnd", Model != null && Model.AuditEnd.HasValue ? Model.AuditEnd.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table border="0" cellspacing="0" summary="table" class="broom_table">
                    <tbody>
                        <tr class="even">
                            <td>
                                完成状态
                                @Html.DropDownListFor(i => i.StatusComplete, new List<SelectListItem>{ 
                                new SelectListItem{ Text="全部",Value="-1" },
                                new SelectListItem{ Text="未完成",Value="0" },
                                new SelectListItem{ Text="已完成",Value="1" }}, new { @class = "select" })
                                审核状态
                                @Html.DropDownListFor(i => i.StatusAudit, new List<SelectListItem>{ 
                                new SelectListItem{ Text="全部",Value="-1" },
                                new SelectListItem{ Text="未审核",Value="0" },
                                new SelectListItem{ Text="已审核",Value="1" }}, new { @class = "select" })
                                质疑状态
                                @Html.DropDownListFor(i => i.StatusQuestion, new List<SelectListItem>{ 
                                new SelectListItem{ Text="全部",Value="-1" },
                                new SelectListItem{ Text="无质疑",Value="0" },
                                new SelectListItem{ Text="有质疑",Value="1" }}, new { @class = "select" })
                                质疑响应
                                @Html.DropDownListFor(i => i.StatusQuestionReply, new List<SelectListItem>{ 
                                new SelectListItem{ Text="全部",Value="-1" },
                                new SelectListItem{ Text="无响应",Value="0" },
                                new SelectListItem{ Text="有响应",Value="1" }}, new { @class = "select" })
                                <div class="button">
                                    <div class="btn-inner">
                                        <span><em>
                                            <button type="submit" style="font-size: 13px;">
                                                搜 索</button>
                                        </em></span>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            }
            @using (Html.BeginForm("manage", "doc", FormMethod.Post, new { @class = "broom_form", id = "form1", style = "margin-left: 30px;" }))
            {
                if (ViewBag.Record != null && ViewBag.Record.Count > 0)
                {
                <h4 class="titlebold">
                    <br />
                    搜索结果列表:共计@(ViewBag.RecordCount)项</h4>
                <table cellspacing="0" summary="table" class="broom_table">
                    <tbody>
                        <tr class="odd titlebold">
                            @* <td>
                            </td>*@
                            <td>
                                病例编号
                            </td>
                            <td>
                                录入人
                            </td>
                            <td>
                                录入时间
                            </td>
                            <td>
                                完成状态
                            </td>
                            <td>
                                审核状态
                            </td>
                            <td>
                                质疑状态
                            </td>
                            <td>
                                质疑回应
                            </td>
                            <td>
                                审核日期
                            </td>
                            <td>
                                操作
                            </td>
                        </tr>
                        @foreach (var DocForShow in (List<Web.Controllers.DocForShow>)ViewBag.Record)
                        {
                            <tr class="@((ti++) % 2 == 0 ? "odd" : "even")">
                                <td>
                                    @DocForShow.doc.DocID
                                </td>
                                <td>
                                    @DocForShow.username
                                </td>
                                <td>
                                    @DocForShow.doc.TimeAdd.ToString("yyyy-MM-dd")
                                </td>
                                <td style="text-align: center">
                                    @if (DocForShow.doc.StatusComplete == 1)
                                    {
                                        if (DocForShow.doc.StatusAudit != 1)
                                        {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "edit" })">
                                            <img src="/assets/img/icons/chinaz13.png" /></a>
                                        }
                                        else
                                        {
                                        <img src="/assets/img/icons/chinaz13.png" />
                                        }
                                    }
                                    else
                                    {
                                        if (DocForShow.doc.StatusAudit != 1)
                                        {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "edit" })">
                                            <img src="/assets/img/icons/exclamation.png" /></a>
                                        }
                                        else
                                        {
                                        <img src="/assets/img/icons/exclamation.png" />
                                        }
                                    }
                                </td>
                                <td style="text-align: center">
                                    @if (DocForShow.doc.StatusAudit == 1)
                                    {
                                        if (Web.Controllers.Common.Admin())
                                        {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "audit" })">
                                            <img src="/assets/img/icons/flaggreen.png" /></a> 
                                        }
                                        else
                                        {
                                        <img src="/assets/img/icons/flaggreen.png" />
                                        }

                                    }
                                    else
                                    {
                                        if (Web.Controllers.Common.Admin())
                                        {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "audit" })">
                                            <img src="/assets/img/icons/chinaz2.png" /></a> 
                                        }
                                        else
                                        {
                                        <img src="/assets/img/icons/chinaz2.png" />
                                        }
                                    }
                                </td>
                                <td style="text-align: center">
                                    @if (Web.Controllers.Common.Admin())
                                    {
                                        if (DocForShow.doc.StatusQuestion == 1)
                                        {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "audit" })">
                                            <img src="/assets/img/icons/hasquestion.png" /></a>
                                        }
                                        else if (DocForShow.doc.StatusQuestion == 2)
                                        {
                                        <a title="已关闭质疑" href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "audit" })">
                                            <img src="/assets/img/icons/hadquestion.png" /></a>
                                        }
                                    }
                                    else
                                    {
                                        if (DocForShow.doc.StatusQuestion == 1)
                                        {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "edit" })">
                                            <img src="/assets/img/icons/hasquestion.png" /></a>
                                        }
                                        else if (DocForShow.doc.StatusQuestion == 2)
                                        {
                                        <a title="已关闭质疑" href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "edit" })">
                                            <img src="/assets/img/icons/hadquestion.png" /></a>
                                        }
                                    }
                                </td>
                                <td style="text-align: center">
                                    @if (Web.Controllers.Common.Admin())
                                    {
                                        if (DocForShow.doc.StatusModify == 1)
                                        {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "audit" })">
                                            <img src="/assets/img/icons/pencil.png" /></a>
                                        }
                                    }
                                    else
                                    {
                                        if (DocForShow.doc.StatusModify == 1)
                                        {
                                        <a href="@Url.Action("edit0", "doc", new { docid = DocForShow.doc.DocID, status = "edit" })">
                                            <img src="/assets/img/icons/pencil.png" /></a>
                                        }
                                    }
                                </td>
                                <td>
                                    @if (DocForShow.doc.TimeAudit.HasValue)
                                    {
                                        @DocForShow.doc.TimeAudit.Value.ToString("yyyy-MM-dd")
                                    }
                                </td>
                                <td>
                                    @if (DocForShow.doc.StatusAudit != 1)
                                    {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "edit" })">
                                            编辑</a> 
                                    }
                                    @if (Web.Controllers.Common.Admin())
                                    {
                                        <a href="@Url.Action("editcommon", "doc", new { docid = DocForShow.doc.DocID, status = "audit" })">
                                            审核</a> 
                                    }
                                    <a target="_blank" href="@Url.Action("", "preview", new { docid = DocForShow.doc.DocID })">
                                        预览</a>
                                    @if (Web.Controllers.Common.Admin())
                                    {
                                        <a href="@Url.Action("delete", "doc", new { docid = DocForShow.doc.DocID })" onclick="return confirm('确定要删除吗')">
                                            删除</a> 
                                    }
                                    <a href="@Url.Action("export", "doc", new { docid = DocForShow.doc.DocID })">导出</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
                }
                else
                {
                <div class="container1">
                    <div class="notification error">
                        <a class="close" href="#"></a><em>
                            <img alt="" src="/assets/img/icons/cross_circle.png">未搜索到数据,请尝试其他搜索条件</em></div>
                </div>
                }
                
                @Html.Pager((int)ViewBag.RecordCount, 10, (int)ViewBag.PageIndex, "manage", "doc", null, null, null, new { @class = "pagination" })
            }
        </div>
    </div>
    <div class="clear">
    </div>
</body>
</html>
